package com.zh.mediaservice.mapper;

import com.zh.mediapojo.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper {
    void insertUser(User user);
    @Select("select * from user where id=#{id}")
    User selectUserById(Long id);

    @Select("select * from user where username=#{username}")
    User selectByUsername(String username);
    @Select("select password from user where id=#{id}")
    String selectPasswordById(Long id);
    @Update("update user set password=#{newPassword} where id=#{id}")
    void updatePassword(Long id,String newPassword);

}
